<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function Student(name){
            this.name=name;
        }
        function Person(name){
            this.name=name;
        }
        function Teacher(name){
            this.name=name;
        }
        var obj1=new Student("alice");
        var obj2=new Person("baby");
        var obj3=new Teacher("babe");
        var obj4=new Array();
        var obj5=new Date();
        console.log(Student.prototype);
        // constructor属性，对象的constructor属性是其原型对象提供的
        // 每个对象都有一个constructor属性，该属性描述的就是其构造函数(构造器)

        //通过调用constructor属性，可以获取到对象的构造函数
        console.log(obj1.constructor);
        console.log(obj2.constructor);
        console.log(obj3.constructor);
        console.log(obj4.constructor);
        console.log(obj5.constructor);

        //通过调用对象的constructor属性中的name属性，可以获取函数名称
        console.log(obj1.constructor.name);
        console.log(obj2.constructor.name);
        console.log(obj3.constructor.name);
        console.log(obj4.constructor.name);
        console.log(obj5.constructor.name);

    </script>
</head>
<body>
    
</body>
</html>